<template>
	<view class="ordermain">
		<custom-swiper ref="swiper" style="height: 100%;" :list="tabs" :bold="true">
			<template v-for="(item, index) of tabs" :slot="'swiper-item-' + (index + 1)">
				<order-list ref="newOrder" :state="tabs[index].state" type="1" :url-api="urlApi" :key="index"></order-list>
			</template>
		</custom-swiper>
	</view>
</template>

<script>
import OrderList from '@/components/template/order/order-list.vue';
import CustomSwiper from '@/components/custom-tabs-page-linkge/tab-page-linkage.vue';
export default {
	components: {
		OrderList,
		CustomSwiper
	},
	data() {
		return {
			urlApi:this.api.wmddlb,
			tabs: [
				{
					name: '新订单',
					state: '1',
					dot: '0'
				},
				{
					name: '待配送',
					state: '6',
					dot: '0'
				},
				{ 
					name: '预订单',
					state: '2',
					dot: '0'
				},
				{
					name: '催单',
					state: '3',
					dot: '0'
				},
				{
					name: '售后',
					state: '4',
					dot: '0'
				}
			]
		};
	},
	methods:{
		changePage(){
			this.$refs.swiper.change(0)
		}
	}
};
</script>

<style lang="scss" scoped>
.ordermain {
	display: flex;
	flex-direction: column;
	flex: 1;
	height: 100%;
}
</style>
